<template>
    <div>
        <Modal v-model="dialogVisible" :title="$t('lang.settingTitle')" cancel-text="" :mask="false" :closable="false"
        :fullscreen="true" width="400" :styles="{top: '20px'}">
            <div style="display: flex;flex-direction: column;align-items: flex-start;margin-left: 60px">
                <span style="margin-top: 10px;">{{$t('lang.setCompanyName')}}{{merchantName}}</span>
                <span style="margin-top: 10px;">{{$t('lang.setTableName')}}{{name}}</span>
                <span style="margin-top: 10px;">{{$t('lang.setVersionName')}}{{version}}</span>
            </div>
            <div slot="footer" style="display: flex;align-items: center;justify-content: center">
                <Button type="primary" @click="logoutWindow" style="width: 200px">{{$t('lang.setLogOut')}}</Button>
            </div>
        </Modal>
    </div>


</template>

<script>
    import config from '../../package.json'
    const {ipcRenderer} = window.require("electron");

    export default {
        name: "logout",
        data(){
            return{
                dialogVisible:true,
                version:config.version,
                merchantName:localStorage.merchantName,
                name:localStorage.name,
                langValue: ''
            }
        },
        methods:{
            logoutWindow(){
                ipcRenderer.send("logout-dialog-remove", '');
                this.langValue = localStorage.langValue
                localStorage.clear()
                localStorage.langValue = this.langValue
                this.$i18n.locale = this.langValue;
            }
        },
        created() {
            this.$i18n.locale = localStorage.langValue
        },
    }
</script>

<style>
</style>